package com.xj.ideatest.action;

import com.intellij.notification.Notification;
import com.intellij.notification.NotificationDisplayType;
import com.intellij.notification.NotificationGroup;
import com.intellij.notification.Notifications;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.ui.MessageType;
import com.xj.ideatest.components.Config;
import com.xj.ideatest.dialog.CustomDialogWrapper;

public class Scdto extends AnAction {

    /**
     * 点击菜单后的事件
     *
     * @param e
     */
    @Override
    public void actionPerformed(AnActionEvent e) {
        boolean b = new CustomDialogWrapper().showAndGet();
        System.out.println("结果：" + b);

        Config config = ApplicationManager.getApplication().getService(Config.class);

        System.out.println(config.getUrl());

        System.out.println("aaaa");
        NotificationGroup NOTIFICATION_GROUP = new NotificationGroup("aaaa", NotificationDisplayType.BALLOON, false);
        Notification notification = NOTIFICATION_GROUP.createNotification("发送通知", MessageType.INFO);
        Notifications.Bus.notify(notification);
    }
}
